import { createStore } from 'vuex'
import myaxios from '@/utils/axios'
import VuexPersistence from 'vuex-persist'
const vuexLocal = new VuexPersistence({
  storage: window.localStorage
})
export default createStore({
  state: {
    likes: {}
  },
  getters: {

  },
  mutations: {
    changelikes(state, info) {
      state.likes = info
    }
  },
  actions: {
    changelikes1(context) {
      myaxios.get('/likesinfo').then(res => {
        context.commit('changelikes', res.list)
      })
    }
  },
  plugins: [vuexLocal.plugin],
  modules: {
  }
})
